<template>
  <div class="battery-bg">
    <el-row :gutter="20" class="stat-row">
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-label">电池数量</div>
          <div class="stat-value">{{ batteryList.length }}
          <span class="stat-label">个</span></div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-label">最大容量</div>
          <div class="stat-value">{{ maxCapacity }}
            <span class="stat-label">kWh</span></div>

        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-label">最大输出功率</div>
          <div class="stat-value">{{ maxOutputPower }}
            <span class="stat-label">kW</span></div>

        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-label">最大输入功率</div>
          <div class="stat-value">{{ maxInputPower }}
            <span class="stat-label">kW</span></div>

        </el-card>
      </el-col>

<!--      <el-col :span="6">-->
<!--        <el-card class="chart-flex-card">-->
<!--          <div class="stat-label" style="text-align:center;">容量分布</div>-->
<!--          <div class="pie-wrapper">-->
<!--            <div ref="capacityPie" class="pie-chart"></div>-->
<!--          </div>-->
<!--        </el-card>-->
<!--      </el-col>-->
    </el-row>

    <el-row :gutter="20" class="chart-row">
      <el-col :span="12">

      <el-card class="chart-card">
        <div class="chart-title">电池容量分布</div>
        <div ref="barChart" class="echart-box"></div>
      </el-card>

      </el-col>

      <el-col :span="12">
        <el-card class="chart-card">
          <div class="chart-title">最大输出/输入功率折线图</div>
          <div ref="lineChart" class="echart-box"></div>
        </el-card>
      </el-col>

    </el-row>

    <el-card class="battery-card" :body-style="{ padding: '20px' }">
      <template #header>
        <span class="card-title">电池信息管理</span>
      </template>
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="79px"
               class="form-in-card">
        <el-form-item label="电池设备名" prop="batteryName">
          <el-input v-model="queryParams.batteryName" placeholder="请输入电池设备名" clearable
                    @keyup.enter.native="handleQuery" />
        </el-form-item>
      </el-form>
      <el-row :gutter="10" class="action-btn-row">
        <el-col :span="1.5">
          <el-button class="action-btn primary" type="primary" plain size="default" @click="handleAdd">
            <Plus /> 新增
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button class="action-btn danger" type="danger" plain size="default" :disabled="multiple" @click="handleDelete">
            <Delete /> 删除
          </el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
      <el-table v-loading="loading" :data="filteredBatteries" @selection-change="handleSelectionChange"
                class="custom-table transparent-table">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="电池设备id" align="center" prop="batteryId" />
        <el-table-column label="电池设备名" align="center" prop="batteryName" />
        <el-table-column label="最大输出功率(kW)" align="center" prop="maxOutputPower" />
        <el-table-column label="最大输入功率(kW)" align="center" prop="maxInputPower" />
        <el-table-column label="电池容量(kWh)" align="center" prop="capacity" />
        <el-table-column label="电池初始容量(kWh)" align="center" prop="initialCapacity" />
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template v-slot:default="scope">
            <el-button size="mini" type="text" @click="handleDelete(scope.row)" class="custom-button">
              删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                  @pagination="getList" />
    </el-card>

    <!-- 添加或修改电池信息对话框 -->
    <el-dialog 
      :title="title" 
      v-model="open" 
      width="580px" 
      append-to-body
      class="battery-dialog"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="140px" class="battery-form">
        <el-form-item label="电池设备名" prop="batteryName">
          <el-input 
            v-model="form.batteryName" 
            placeholder="请输入电池设备名" 
            class="form-input"
            clearable
          />
        </el-form-item>
        <el-form-item label="最大输出功率" prop="maxOutputPower">
          <el-input 
            v-model="form.maxOutputPower" 
            placeholder="请输入最大输出功率" 
            type="number" 
            class="form-input"
            clearable
          >
            <template #append>kW</template>
          </el-input>
        </el-form-item>
        <el-form-item label="最大输入功率" prop="maxInputPower">
          <el-input 
            v-model="form.maxInputPower" 
            placeholder="请输入最大输入功率" 
            type="number" 
            class="form-input"
            clearable
          >
            <template #append>kW</template>
          </el-input>
        </el-form-item>
        <el-form-item label="电池容量" prop="capacity">
          <el-input 
            v-model="form.capacity" 
            placeholder="请输入电池容量" 
            type="number" 
            class="form-input"
            clearable
          >
            <template #append>kWh</template>
          </el-input>
        </el-form-item>
        <el-form-item label="电池初始容量" prop="initialCapacity">
          <el-input 
            v-model="form.initialCapacity" 
            placeholder="请输入电池初始容量" 
            type="number" 
            class="form-input"
            clearable
          >
            <template #append>kWh</template>
          </el-input>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="cancel" class="cancel-btn">取消</el-button>
          <el-button type="primary" @click="submitForm" class="confirm-btn">确定</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script>
// import { Edit, Delete, Plus, Search, Download } from '@element-plus/icons-vue'; 
import { listBattery, getBattery, delBattery, addBattery, batchDelBattery } from "../../../api/system/battery.js";
import { Delete, Download, Plus, Refresh, Search } from "@element-plus/icons-vue";
import { onMounted, nextTick } from 'vue';
import * as echarts from 'echarts';


export default {

  name: "Battery",
  components: { Download, Plus, Delete, Search, Refresh },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 电池信息表格数据
      batteryList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        batteryName: null,
        maxOutputPower: null,
        maxInputPower: null,
        capacity: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        batteryName: [
          { required: true, message: "电池设备名不能为空", trigger: "blur" }
        ],
        maxOutputPower: [
          { required: true, message: "最大输出功率不能为空", trigger: "blur" }
        ],
        maxInputPower: [
          { required: true, message: "最大输入功率不能为空", trigger: "blur" }
        ],
        capacity: [
          { required: true, message: "电池容量不能为空", trigger: "blur" }
        ],
        initialCapacity: [
          { required: true, message: "电池初始容量不能为空", trigger: "blur" }
        ]
      }
    };
  },
  computed: {
    totalCapacity() {
      return this.batteryList.reduce((sum, b) => sum + (Number(b.capacity) || 0), 0);
    },
    maxOutputPower() {
      return this.batteryList.reduce((max, b) => Math.max(max, Number(b.maxOutputPower) || 0), 0);
    },
    maxInputPower() {
      return this.batteryList.reduce((min, b) => Math.max(min, Number(b.maxInputPower) || 0), 0);
    },
    maxCapacity() {
      return this.batteryList.reduce((max, b) => Math.max(max, Number(b.capacity) || 0), 0);
    },
    filteredBatteries() {
      if (!this.queryParams.batteryName || !this.queryParams.batteryName.trim()) {
        return this.batteryList; // 无搜索词时返回全部数据
      }

      const query = this.queryParams.batteryName.trim().toLowerCase();
      return this.batteryList.filter(battery => {
        // 在名称或型号中进行模糊匹配
        return battery.batteryName.toLowerCase().includes(query)
      });
    }
  },
  watch: {
    batteryList: {
      handler() {
        this.$nextTick(() => {
          this.renderCapacityPie();
          this.renderBarChart();
          this.renderLineChart();
        });
      },
      deep: true
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.renderCapacityPie();
      this.renderBarChart();
      this.renderLineChart();
    });
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      this.loading = true;
      listBattery(this.queryParams).then(response => {
        this.batteryList = response.data.data;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        batteryName: null,
        maxOutputPower: null,
        maxInputPower: null,
        capacity: null,
        initialCapacity: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      if (!this.queryParams.batteryName.trim()) {
        return this.batteryList; // 无搜索词时返回全部数据
      }

      const query = this.queryParams.batteryName.trim().toLowerCase();
      this.batteryList = this.batteryList.filter(battery => {
        // 在名称或型号中进行模糊匹配
        return battery.batteryName.toLowerCase().includes(query)
      });
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.batteryId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加电池信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const batteryId = row.batteryId || this.ids
      getBattery(batteryId).then(response => {
        this.form = response.data.data;
        this.open = true;
        this.title = "修改电池信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.batteryId != null) {
            // updateBattery(this.form).then(response => {
            //   this.$modal.msgSuccess("修改成功");
            //   this.open = false;
            //   this.getList();
            // });
          } else {
            addBattery(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const batteryIds = row.batteryId ? [row.batteryId] : this.ids;
      const data = {
        battery_ids: batteryIds
      }
      this.$modal.confirm('是否确认删除电池信息编号为"' + batteryIds + '"的数据项？').then(function () {
        return batchDelBattery(data);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/battery/export', {
        ...this.queryParams
      }, `battery_${new Date().getTime()}.xlsx`)
    },
    renderCapacityPie() {
      // 确保DOM元素已完全加载
      if (!this.$refs.capacityPie) return;

      // 获取容器DOM元素
      const container = this.$refs.capacityPie;

      // 如果已有实例，先销毁
      if (echarts.getInstanceByDom(container)) {
        echarts.getInstanceByDom(container).dispose();
      }
      const chart = echarts.init(this.$refs.capacityPie);
      const data = this.batteryList.map(b => ({
        value: Number(b.capacity) || 0,
        name: b.batteryName || b.batteryId
      }));
      chart.setOption({
        // 添加图例配置
        // legend: {
        //   type: 'scroll', // 滚动图例，防止数据过多时溢出
        //   orient: 'vertical', // 垂直布局
        //   // right: '10%', // 图例在右侧，距离右边 10% 的位置
        //   left:'70%',
        //   top: 'center', // 图例垂直居中
        //   itemWidth: 5, // 图例项的宽度
        //   itemHeight: 5, // 图例项的高度
        //   width: 1,    // 设置最大宽度，超出部分自动显示省略号
        //   textStyle: {
        //     fontSize: 10, // 图例文字大小
        //     color: '#171616' // 图例文字颜色
        //   }
        // },
        tooltip: { 
          trigger: 'item',
          confine: true, // 限制在图表区域内
          // formatter: '{b}: {c} ({d}%)',
          extraCssText: 'max-width: 300px; white-space: normal;'
        },
        series: [{
          name: '容量分布',
          type: 'pie',
          radius: ['40%', '70%'],
          avoidLabelOverlap: false,
          label: { show: false },
          emphasis: { label: { show: true, fontSize: 14, fontWeight: 'bold' } },
          data
        }]
      });
    },

    renderBarChart() {
      if (!this.$refs.barChart) return;
      const chart = echarts.init(this.$refs.barChart);
      const names = this.batteryList.map(b => b.batteryName || b.batteryId);
      const values = this.batteryList.map(b => Number(b.capacity) || 0);
      chart.setOption({
        tooltip: {
          trigger: 'axis',
          formatter: function(params) {
            const item = params[0];
            // item.marker 就是那个小色块
            return `${item.marker}${item.axisValue}<br/>容量 :  ${item.data} kWh`;
          }
        },
        grid: { left: '10%', right: '10%', top: 40, bottom: 40 },
        xAxis: {
          type: 'category',
          data: names,
          axisLabel: {
            fontFamily: 'Microsoft YaHei',
            fontSize: 12,
            rotate: 20,
            interval: 0
          }
        },
        yAxis: {
          type: 'value',
          name:'容量(kWh)',
          min: 0, // 设置纵坐标最小值为 0
          minInterval: 100, // 保证最小间隔为1
          axisLabel: { fontFamily: 'Microsoft YaHei', fontSize: 12 }
        },
        series: [{
          data: values,
          type: 'bar',
          itemStyle: { color: '#1976d2' },
          barWidth: '50%',
          label: { show: true, position: 'top', fontFamily: 'Microsoft YaHei', fontSize: 12 }
        }],
        textStyle: { fontFamily: 'Microsoft YaHei', fontSize: 12 }
      });
    },
    renderLineChart() {
      if (!this.$refs.lineChart) return;
      const chart = echarts.init(this.$refs.lineChart);
      const names = this.batteryList.map(b => b.batteryName || b.batteryId);
      const outputValues = this.batteryList.map(b => Number(b.maxOutputPower) || 0);
      const inputValues = this.batteryList.map(b => Number(b.maxInputPower) || 0);
      chart.setOption({
        tooltip: {
          trigger: 'axis',
          formatter: function(params) {
            let str = params[0].axisValue + '<br/>';
            params.forEach(item => {
              str += `${item.marker}${item.seriesName}：${item.data} kW<br/>`;
            });
            return str;
          }
        },
        legend: { data: ['最大输出功率', '最大输入功率'] }, // 增加图例
        grid: { left: '10%', right: '10%', top: 40, bottom: 40 },
        xAxis: {
          type: 'category',
          data: names,
          axisLabel: {
            fontFamily: 'Microsoft YaHei',
            fontSize: 12,
            rotate: 20,
            interval: 0
          }
        },
        yAxis: {
          type: 'value',
          name:'功率(kW)',
          min: 0,
          minInterval: 100,
          axisLabel: { fontFamily: 'Microsoft YaHei', fontSize: 12 }
        },
        series: [
          {
            name: '最大输出功率',
            data: outputValues,
            type: 'line',
            smooth: true,
            itemStyle: { color: '#0a853b' },
            lineStyle: { width: 3 },
            label: { show: true, position: 'top', fontFamily: 'Microsoft YaHei', fontSize: 12 }
          },
          {
            name: '最大输入功率',
            data: inputValues,
            type: 'line',
            smooth: true,
            itemStyle: { color: '#ffa726' },
            lineStyle: { width: 3 },
            label: { show: true, position: 'top', fontFamily: 'Microsoft YaHei', fontSize: 12 }
          }
        ],
        textStyle: { fontFamily: 'Microsoft YaHei', fontSize: 12 }
      });
    }
  }
};
</script>

<style scoped>
.battery-bg {
  min-height: 100vh;
  background-color: #f9fbfd;
  color: #222;
  font-family: Arial, sans-serif;
  padding: 20px 0;
}

.battery-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #d1d7dc;
  margin: 20px auto;
  box-shadow: 0 2px 8px rgba(90, 150, 255, 0.08);
  max-width: 1400px;
}

.card-title {
  font-size: 20px;
  font-weight: bold;
  color: #1976d2;
}

.form-in-card {
  margin-bottom: 0px;
  padding-bottom: 0px;
}

.action-btn-row {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-btn {
  border-radius: 20px !important;
  font-size: 15px !important;
  font-weight: 500;
  min-width: 90px;
  height: 38px;
  box-shadow: 0 2px 8px rgba(90, 150, 255, 0.08);
  transition: all 0.2s;
  margin-right: 8px;
  letter-spacing: 1px;
}

.action-btn.primary {
  background: #64b5f6 !important;
  color: #1976d2 !important;
  border: none;
}
.action-btn.primary:hover {
  color: #fff !important;
  background: #42a5f5 !important;
}

.action-btn.danger {
  background: #ef9a9a !important;
  color: #b71c1c !important;
  border: none;
}
.action-btn.danger:hover {
  color: #fff !important;
  background: #e57373 !important;
}

.action-btn:disabled,
.action-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e0e0e0 !important;
  color: #aaa !important;
  border: none !important;
}

.custom-table {
  background: transparent;
}

.transparent-table .el-table__body tr {
  background-color: transparent !important;
}

.el-table th {
  background-color: transparent !important;
  color: #222;
}

.el-table tr {
  background-color: transparent !important;
}

.el-table tr:nth-child(even) {
  background-color: rgba(187, 222, 251, 0.0) !important;
}

.el-table td {
  border-bottom: 1px solid #bbdefb;
}

.custom-button {
  color: #1976d2;
}

.custom-button:hover {
  color: #1565c0;
}

:deep(svg) {
  width: 14px !important;
  height: 14px !important;
  vertical-align: middle;
  text-align: center;
}

.stat-row {
  margin-bottom: 20px;
}

.stat-card {
  text-align: center;
  background: white;
  border: 1px solid #d1d7dc;
  border-radius: 10px;
  min-height: 120px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 10px;
}


.stat-card-pie {
  justify-content: center;
  align-items: center;
  padding: 0 10px;
}

/* 图表卡片内标题样式 */
.chart-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px; /* 与统计卡片数值、标签间距呼应 */
  color: #333;
}

/* 图表容器样式（适配 ECharts 渲染） */
.echart-box {
  width: 100%;
  height: 300px; /* 保证图表有足够显示空间，可根据需求调整 */
}


.pie-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 80px;
  overflow: visible;
}

.pie-chart {
  width: 200px;
  height:120px;
  overflow: visible;
}

.stat-value {
  font-size: 30px;
  font-weight: bold;
  margin-top: 18px;
}

.stat-label {
  font-size: 18px;
  margin-top: 5px;
  color: #6B7280;
}

.chart-row {
  margin-bottom: 20px;
}

.chart-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #d1d7dc;

}

.chart-flex-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #d1d7dc;
  overflow: visible;
  min-height: 120px;
  padding:0 !important;
  height: 140px; /* 增加高度 */
}
/* 修复可能的样式冲突 */
:deep(svg) {
  width: 14px !important;
  height: 14px !important;
  vertical-align: middle;
  text-align: center;
}

/* 电池对话框样式 */
:deep(.battery-dialog .el-dialog) {
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

:deep(.battery-dialog .el-dialog__header) {
  background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
  padding: 24px 30px 20px;
  margin: 0;
  border-bottom: none;
}

:deep(.battery-dialog .el-dialog__title) {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

:deep(.battery-dialog .el-dialog__headerbtn) {
  top: 24px;
  right: 30px;
}

:deep(.battery-dialog .el-dialog__headerbtn .el-dialog__close) {
  color: #ffffff;
  font-size: 20px;
  font-weight: bold;
}

:deep(.battery-dialog .el-dialog__headerbtn:hover .el-dialog__close) {
  color: #e3f2fd;
  transform: scale(1.1);
}

:deep(.battery-dialog .el-dialog__body) {
  padding: 30px;
  background: #fafbfc;
}

.battery-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

:deep(.battery-form .el-form-item) {
  margin-bottom: 24px;
}

:deep(.battery-form .el-form-item__label) {
  color: #374151;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
}

:deep(.battery-form .el-form-item__content) {
  line-height: 1;
}

.form-input {
  border-radius: 8px;
  transition: all 0.3s ease;
}

:deep(.form-input .el-input__wrapper) {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  background: #ffffff;
}

:deep(.form-input .el-input__wrapper:hover) {
  border-color: #90caf9;
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.1);
}

:deep(.form-input .el-input__wrapper.is-focus) {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

:deep(.form-input .el-input__inner) {
  color: #374151;
  font-size: 14px;
  padding: 12px 16px;
}

:deep(.form-input .el-input__inner::placeholder) {
  color: #9ca3af;
  font-size: 14px;
}

:deep(.form-input .el-input-group__append) {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-left: none;
  color: #6b7280;
  font-weight: 500;
  font-size: 13px;
  padding: 0 12px;
  border-radius: 0 8px 8px 0;
}

:deep(.battery-dialog .el-dialog__footer) {
  background: #ffffff;
  padding: 20px 30px 30px;
  border-top: 1px solid #f3f4f6;
  margin: 0;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cancel-btn {
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  color: #6b7280;
  background: #ffffff;
  transition: all 0.3s ease;
}

.cancel-btn:hover {
  border-color: #9ca3af;
  color: #374151;
  background: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.confirm-btn {
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 500;
  background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
  border: none;
  color: #ffffff;
  transition: all 0.3s ease;
}

.confirm-btn:hover {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(25, 118, 210, 0.3);
}

.confirm-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}
</style>